#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	long long arr[40][40] = { 0 };
	int n = 0;
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < i + 1; j++)
		{
			if (i == j || j == 0)
			{
				arr[i][j] = 1;
			}
			else
			{
				arr[i][j] = arr[i - 1][j - 1] + arr[i - 1][j];
			}
		}
	}
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < i + 1; j++)
		{
			printf("%lld ", arr[i][j]);
		}
		printf("\n");
	}
	printf("\n");
	int t = 0;
	for (int i = n - 1; i >= 0; i--)
	{
		for (int j = 0; j < n - t ; j++)
		{
			printf("%lld ", arr[i][j]);
			
		}
		t++;
		printf("\n");
	}


	return 0;
}